/**
 * Copyright (c) 2009-2011, chunquedong(YangJiandong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 
 * History:
 *     2010-05-05  Jed Young  Creation
 */
package chunmap.util;

import java.util.ArrayList;
import java.util.List;

/**
 * 事件监听
 * @author yangjiandong
 *
 */
public class CMEventListenerList {
	private List<Function> list=new ArrayList<Function>();
	
	public void add(Function func){
		list.add(func);
	}
	public void remove(Function func){
		list.remove(func);
	}
	public void clear(){
		list.clear();
	}
	
	public void fire(Object... obj){
		for(Function f: list){
			f.call(obj);
		}
	}
	public int size(){
		return list.size();
	}
}